package com.example.photongrid;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.TextView;


public class OptionsMenu extends Activity{
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.options);
		
		ImageButton imageButton1 =(ImageButton)findViewById(R.id.imageButton1);
		imageButton1.setOnClickListener(buttonhandler);
		ImageButton imageButton2 =(ImageButton)findViewById(R.id.imageButton2);
		imageButton2.setOnClickListener(buttonhandler);
		ImageButton ImageButton01 =(ImageButton)findViewById(R.id.ImageButton01);
		ImageButton01.setOnClickListener(buttonhandler);
		ImageButton ImageButton02 =(ImageButton)findViewById(R.id.ImageButton02);
		ImageButton02.setOnClickListener(buttonhandler);
		
	}
	View.OnClickListener buttonhandler=new View.OnClickListener() { 

		public void onClick(View v) {
			TextView textView1 = (TextView) findViewById(R.id.textView1);
			
			switch(v.getId()) { 

			case R.id.imageButton1:    
				StateManager.model=1;
				textView1.setText("Model 2 Selected");  				
				break; 
			case R.id.imageButton2:    
				StateManager.model=0;
				textView1.setText("Model 1 Selected");  
				break; 
			case R.id.ImageButton01:    
				StateManager.grid=0;
				textView1.setText("Grid 2 Selected");  				
				break; 
			case R.id.ImageButton02:    
				StateManager.grid=1;
				textView1.setText("Grid 1 Selected");  
				break; 
			} 
		} 
	};
	
}
